Skip to content

Added provider for closures of New York Stock Exchange (NYSE) since 2000.#382

Closed
mgwebgroup wants to merge 8 commits into
azuyalabs:developfrom
mgwebgroup:nyse-closures
Closed

Added provider for closures of New York Stock Exchange (NYSE) since 2000.#382
mgwebgroup wants to merge 8 commits into
azuyalabs:developfrom
mgwebgroup:nyse-closures

Conversation

@mgwebgroup

Copy link
Copy Markdown
Contributor

Greetings to Azuyalabs!

I have added a holiday provider to track holidays and closures for the New York Stock Exchange. In addition to observed holidays, the closures include emergency, weather and presidential proclamation events since year 2000. Other US exchanges like NASDAQ and CBOE normally follow suit for holidays and closures.

Summary of changes:

  • New provider class in src/Yasumi/Provider/USA/NYSE.php
  • Tests in tests/USA/NYSE/ directory.

The motivation of these changes is to provide good foundation for developers of trading packages to be able to determine availability of trading days.

Additional Notes:

  • All code additions were linted with symfony's cs-fixer. I hope they will be found acceptable.
  • Tests have been written to follow your guidelines for submission of contributions.
  • If any clarifications or adjustments are needed, I will be happy to make further changes based on your feedback.

Thank you for your time and consideration! I look forward to your review and comments.

#376)

Without this, the holiday's name won't be translated. All other calculateHoliday() methods properly provide this argument, thus being translated.

If you try this code:

```php
        $holiday = Yasumi::create(Brazil::class, 2025, 'pt_BR');
        $this->assertEquals(
            'Dia da Proclamação da República',
            $holiday->getHoliday(self::HOLIDAY)->getName()
        );
```

It'll fail.

Signed-off-by: Mateus Ribeiro Bossa <mateus.rbossa@gmail.com>
@stelgenhof

stelgenhof commented Jul 18, 2025

Copy link
Copy Markdown
Member

Thank you @mgwebgroup for this PR. You turned one of the code examples into a provider. Nice! Let me do a review this weekend.

Art Kurbakov added 5 commits July 19, 2025 22:52
Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>
Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>
Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>
Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>
Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>

@stelgenhof stelgenhof left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good overall! The tests are failing unfortunately, and there are few small things that can be improved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be part of your PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I grabbed it off of the develop branch when got started. Will remove from my PR.

Comment thread src/Yasumi/Provider/USA/NYSE.php Outdated
}
}

private function addEmergencies()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is missing a return type (void).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added void return type.

}
}

private function addProclamations()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is missing a return type (void).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added void return type.

];
}

private function addWeatherEvents()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is missing a return type (void).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added void return type.

Comment thread src/Yasumi/Provider/USA/NYSE.php Outdated
mgwebgroup and others added 2 commits August 10, 2025 12:19
Co-authored-by: Sacha Telgenhof <me@sachatelgenhof.com>
Signed-off-by: Art Kurbakov <mgwebgroup@users.noreply.github.com>
Co-authored-by: Sacha Telgenhof <me@sachatelgenhof.com>
Signed-off-by: Art Kurbakov <mgwebgroup@users.noreply.github.com>
@mgwebgroup mgwebgroup closed this Aug 11, 2025
@mgwebgroup mgwebgroup deleted the nyse-closures branch August 11, 2025 03:23
@mgwebgroup

mgwebgroup commented Aug 11, 2025

Copy link
Copy Markdown
Contributor Author

I had to rebase the nyse-closures branch from commit c747552 so that src/Yasumi/Provider/Brazil.php is not included.
All your changes to nyse-closures branch implemented and re-pushed to mgweb/yasumi fork.
Pull request closed automatically because I opted to delete remote branch, then pushed again.
Not sure if I need to open a new PR - I am unable to re-open this one.

@stelgenhof

Copy link
Copy Markdown
Member

@mgwebgroup If you still have your own branch, you could create a new PR again I think.

stelgenhof pushed a commit that referenced this pull request Sep 1, 2025
#384)

Added a holiday provider to track holidays and closures for the New York
Stock Exchange. In addition to observed holidays, the closures include
emergency, weather and presidential proclamation events since year 2000.
Other US exchanges like NASDAQ and CBOE normally follow suit for
holidays and closures.

This PR supersedes PR #382.

---------

Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>
Co-authored-by: Art Kurbakov <admin@mgwebgroup.com>
stelgenhof pushed a commit that referenced this pull request Sep 1, 2025
Added a holiday provider to track holidays and closures for the New York
Stock Exchange. In addition to observed holidays, the closures include
emergency, weather and presidential proclamation events since year 2000.
Other US exchanges like NASDAQ and CBOE normally follow suit for
holidays and closures.

This PR supersedes PR #382.

---------

Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>
Co-authored-by: Art Kurbakov <admin@mgwebgroup.com>
stelgenhof pushed a commit that referenced this pull request Sep 1, 2025
Added a holiday provider to track holidays and closures for the New York
Stock Exchange. In addition to observed holidays, the closures include
emergency, weather and presidential proclamation events since year 2000.
Other US exchanges like NASDAQ and CBOE normally follow suit for
holidays and closures.

This PR supersedes PR #382.

---------

Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>
Co-authored-by: Art Kurbakov <admin@mgwebgroup.com>
hamrak pushed a commit to hamrak/yasumi that referenced this pull request Nov 11, 2025
Added a holiday provider to track holidays and closures for the New York
Stock Exchange. In addition to observed holidays, the closures include
emergency, weather and presidential proclamation events since year 2000.
Other US exchanges like NASDAQ and CBOE normally follow suit for
holidays and closures.

This PR supersedes PR azuyalabs#382.

---------

Signed-off-by: Art Kurbakov <admin@mgwebgroup.com>
Co-authored-by: Art Kurbakov <admin@mgwebgroup.com>
Signed-off-by: Ján Hamrák <hamrak@kcorp.sk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants